{% block operation %}


<form class="form-horizontal" id="ae_form" action="/pg/as_TipoCategoria/OrdinaSalva" method="post" role="form">
        <input type="hidden" name="ordine" id="ordine" />
<br/>
<div class="form-group" style="border: 2px solid #e7e7e7;">
    <div class="col-sm-5 col-lg-5" >
        <ul id="sortable" class="connectedSortable">
            {% for d in pageData["daos"] %}
            <li class="sorta" id="{{d.id}}" >{{d.denominazione}}</li>
            {% endfor %}
        </ul>
    </div>
</div>

    <div class="form-group" title="Bottoni di salvataggio e reset del form">
        <input class="btn btn-primary" type="button" id="salva" value="Salva" name="add"/>
    </div>
</form>

{%endblock%}
{% block custom_js %}

<script type="text/javascript">
$(document).ready(function () {
$(".Preview").hide()
$("a#anteprima").hide()
//$(".Edit_dao").hide()

$( "#sortable").sortable();

$("#salva").click( function(e){
        var sortedIDs = $( "#sortable" ).sortable( "toArray" );
        $("#ordine").val(sortedIDs)
        $("#ae_form").submit()
});

});
</script>
{% endblock %}
